package com.iwhalecloud.citybrain.flow.platform.manager.common.client;

import java.util.List;
import java.util.Map;

/**
 * @author lilh
 * @date 2019-02-18 21:26
 */
public class HttpSignForwardBeforeDto extends HttpCommandDto {
    private static final long serialVersionUID = 7995471312257856063L;

    private String workItemId;
    private List<Map<String, String>> participantList;
    private Map<String, String> flowPassList;

    public HttpSignForwardBeforeDto() {
        this.setCommandCode("signForwardBefore");
    }

    @SuppressWarnings("unchecked")
    @Override
    public void init(Map<String, Object> paramsMap) {
        super.init(paramsMap);
        String participantList = "PARTICIPANT_LIST";
        if (paramsMap.get(participantList) != null) {
            this.participantList = (List) paramsMap.get(participantList);
        }

        String flowPassList = "FLOW_PASS_LIST";
        if (paramsMap.get(flowPassList) != null) {
            this.flowPassList = (Map) paramsMap.get(flowPassList);
        }

        this.workItemId = String.valueOf(paramsMap.get("WORKITEMID"));
    }

    @Override
    public Map<String, Object> toMap() {
        Map<String, Object> map = super.toMap();
        map.put("WORKITEMID", this.workItemId);
        map.put("PARTICIPANT_LIST", this.participantList);
        map.put("FLOW_PASS_LIST", this.flowPassList);
        return map;
    }

    public String getWorkItemId() {
        return this.workItemId;
    }

    public List<Map<String, String>> getParticipantList() {
        return this.participantList;
    }

    public void setWorkItemId(String workItemId) {
        this.workItemId = workItemId;
    }

    public void setParticipantList(List<Map<String, String>> participantList) {
        this.participantList = participantList;
    }

    public Map<String, String> getFlowPassList() {
        return this.flowPassList;
    }

    public void setFlowPassList(Map<String, String> flowPassList) {
        this.flowPassList = flowPassList;
    }
}
